Passing your own template as an attribute#15
Passing your own template as an attribute#15vrinceanuv wants to merge 5 commits intostofolus:masterfrom
Conversation
|
Hello @vrinceanuv and thank you for you contribution. I understand what your need it but I'm not sure if this would be the best way of solving it. This would require every project that wants to use the default template to make additional configuration in their buildchain (If I'm wrong please let me know). I think there might be a few other solutions to this that would require less work from everyone using the plugin.
|
|
@stofolus You are right, indeed. I am thinking at a solution of having a fallback to template when we don't have a templateUrl defined. So far, I haven't found a solution. Will update as soon as I have one and let you know. If you have something in mind that would be great. |
|
I can probably throw together a small PR tonight and you can have a look at it and let me know if that would work for your needs |
|
Thanks. What I need is to be able to pass my own template. This is what I tried to get done here, but for sure, it brakes functionality for others using this already. |
|
And why I try to do this? Because i want to use the npm package(https://www.npmjs.com/package/angular-range-slider) to do that and just use it in my project instead of changing the directive locally. So far no idea for the solution poped up. |
|
What kind of changes do you need locally? Maybe it can be solved some other way? |
|
I tried to change the template from another directive, but without any chance. I need some additions to the template which are required depending on how many steps i have. I require a separator(mark-up and style) after every step. This is why I needed another template. |
|
@stofolus I found a solution to this problem. If user specifies "template-url" attribute, the template specified will be used, if not the default inline defined template will be used. You can test this as well, I just did and it works as supposed. Also i removed the grunt-copy and the other non-sense. |
|
@stofolus Have you had some time to look over this? Thanks |
|
I haven't had a chance yet. I'll try to look at it tonight |
|
@stofolus I don't want to be a pain, but maybe these days you will have 10-15 minutes to take a look at the PR and test out the feature added. Thanks |
|
Sorry for the late response. I'm not sure if I like this solution. I feel like manually compiling the template is hacky. I'm also questioning how many people would have a need of a custom template when the template is so tightly coupled with the directive. Would it instead be possible to add opt-in functionality that would add a line for every step? |
|
Hey, well I added something you suggested. So what this thing does is actually give the dev the opportunity to add its own template and it is the only way given the inline template definition. I couldn't find another way around given the directive built. |
The possibility to have your own template by passing the template path as a attribute or using the default one from distribute folder
You need a localhost server to have it working due to cross origin. (http-server should work)
https://www.npmjs.com/package/http-server